import java.util.*;

public class TestStudent {

	public static void main(String[] args) {
		
		Scanner reader = new Scanner(System.in);

		System.out.print("Enter the name: ");		
		String name = reader.nextLine();
		Student s1 = new Student(name);
		
		try {
			System.out.print("Enter the number of quizzes: ");
			int numberOfQuizzes = reader.nextInt();
			
			
			
			int count = 0;
			while (count < numberOfQuizzes) {
				count++;
				System.out.print("Enter the grade of quiez #" + count + " for " + name + ": ");
				s1.addQuiz(reader.nextDouble());
			}
			
			System.out.println("\n" + s1.toString());
			
			System.out.printf("Quiez Average: %.2f" , s1.getAverage());
			
		} catch (InputMismatchException | IllegalArgumentException | UnsupportedOperationException e) {
			System.out.print("Error: " + e);
		} 
		
		
	}

}
